xen.git
15 years agorombios: pause for a keypress after a failed boot
Keir Fraser [Tue, 6 Jul 2010 15:49:59 +0000 (16:49 +0100)]
rombios: pause for a keypress after a failed boot

rombios: inform the user and pause for a keypress after a failed boot
rather than powering off immediately.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
15 years agoAdd an exact-node request flag for mem allocations.
Keir Fraser [Mon, 5 Jul 2010 07:40:26 +0000 (08:40 +0100)]
Add an exact-node request flag for mem allocations.

Signed-off-by : Dulloor <dulloor@gmail.com>

15 years agox2APIC: improve enabling logic
Keir Fraser [Mon, 5 Jul 2010 07:31:29 +0000 (08:31 +0100)]
x2APIC: improve enabling logic

This patch masks PIC and IOAPIC RTE's before x2APIC enabling, unmask
and restore them after x2APIC enabling. It also really enables
interrupt remapping before x2APIC enabling instead of just checking
interrupt remapping setting. This patch also handles all x2APIC
configuration including BIOS settings and command line
settings. Especially, it handles that BIOS hands over in x2APIC mode
(when there is apic id > 255). It checks if x2APIC is already enabled
by BIOS. If already enabled, it will disable interrupt remapping and
queued invalidation first, then enable them again.

Signed-off-by: Weidong Han <weidong.han@intel.com>
15 years agox2APIC/VT-d: improve interrupt remapping and queued invalidation enabling and disabling
Keir Fraser [Mon, 5 Jul 2010 07:30:25 +0000 (08:30 +0100)]
x2APIC/VT-d: improve interrupt remapping and queued invalidation enabling and disabling

x2APIC depends on interrupt remapping, so interrupt remapping needs to
be enabled before x2APIC. Usually x2APIC is not enabled
(x2apic_enabled=0) when enable interrupt remapping, although x2APIC
will be enabled later. So it needs to pass a parameter to set
interrupt mode in intremap_enable, instead of checking
x2apic_enable. This patch adds a parameter "eim" to intremap_enable to
achieve it.  Interrupt remapping and queued invalidation are already
enabled when enable x2apic, so it needn't to enable them again when
setup iommu. This patch checks if interrupt remapping and queued
invalidation are already enable or not, and won't enable them if
already enabled. It does the similar in disabling, that's to say don't
disable them if already disabled.

Signed-off-by: Weidong Han <weidong.han@intel.com>
15 years agox2APIC/VT-d: allocate iommu when create a drhd
Keir Fraser [Mon, 5 Jul 2010 07:29:10 +0000 (08:29 +0100)]
x2APIC/VT-d: allocate iommu when create a drhd

A drhd is created when parse ACPI DMAR table, but drhd->iommu is not
allocated until iommu setup. But iommu is needed by x2APIC which will
enable interrupt remapping before iommu setup. This patch allocates
iommu when create drhd. And then drhd->ecap can be removed because
it's the same as iommu->ecap.

Signed-off-by: Weidong Han <weidong.han@intel.com>
15 years agoVT-d: No need to emulate WBINVD when force snooping feature available
Keir Fraser [Mon, 5 Jul 2010 07:28:08 +0000 (08:28 +0100)]
VT-d: No need to emulate WBINVD when force snooping feature available

There is no cache coherency issue if VT-d engine's force snooping
feature available.

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
15 years agoVMX: fix ept pages free up when ept superpage split fails:
Keir Fraser [Mon, 5 Jul 2010 07:27:26 +0000 (08:27 +0100)]
VMX: fix ept pages free up when ept superpage split fails:
1) implement ept super page split in a recursive way to
   form an ept sub tree before real installation;
2) free an ept sub tree also in a recursive way.
3) change ept_next_level last input parameter from shift
   bits # to next walk level;

Signed-off-by: Xin Li <xin.li@intel.com>
15 years agotrace: insert compiler memory barriers
Keir Fraser [Mon, 5 Jul 2010 07:24:18 +0000 (08:24 +0100)]
trace: insert compiler memory barriers

This is to ensure fields shared writably with Dom0 get read only once
for any consistency checking followed by actual calculations.

I realized there was another multiple-read issue, a fix for which is
also included (which at once simplifies __insert_record()).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agoAMD OSVW (OS Visible Workaround) for Xen
Keir Fraser [Fri, 2 Jul 2010 18:04:57 +0000 (19:04 +0100)]
AMD OSVW (OS Visible Workaround) for Xen

This path enables AMD OSVW (OS Visible Workaround) feature for
Xen. New AMD errata will have a OSVW id assigned in the future. OS is
supposed to check OSVW status MSR to find out whether CPU has a
specific erratum. Legacy errata are also supported in this patch:
traditional family/model/stepping approach will be used if OSVW
feature isn't applicable.  This patch is adapted from Hans Rosenfeld's
patch submitted to Linux kernel.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
Signed-off-by: Hans Rosenfeld <hands.rosenfeld@amd.com>
Acked-by: Jan Beulich <jbeulich@novell.com>
15 years agox86: Fix (bogus) use-before-initialise compiler warning.
Keir Fraser [Fri, 2 Jul 2010 18:03:16 +0000 (19:03 +0100)]
x86: Fix (bogus) use-before-initialise compiler warning.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoVMX: cleanup ept_set_entry:
Keir Fraser [Fri, 2 Jul 2010 18:00:04 +0000 (19:00 +0100)]
VMX: cleanup ept_set_entry:
1) more strict input parameters checking;
2) better comments;
3) fewer variable;
4) change direct_mmio type to bool_t.

Signed-off-by: Xin Li <xin.li@intel.com>
15 years agoRemove stale file xen/arch/x86/hvm/vmx/vpmu.c
Keir Fraser [Fri, 2 Jul 2010 17:59:36 +0000 (18:59 +0100)]
Remove stale file xen/arch/x86/hvm/vmx/vpmu.c

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoio: make shared ring pad field less enticing for users by adding a __ prefix
Keir Fraser [Fri, 2 Jul 2010 17:58:28 +0000 (18:58 +0100)]
io: make shared ring pad field less enticing for users by adding a __ prefix

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Daniel Stodden <daniel.stodden@citrix.com>
Cc: Dongxiao Xu <dongxiao.xu@intel.com>
15 years agoblktap2: make protocol specific usage of shared sring explicit
Keir Fraser [Fri, 2 Jul 2010 17:58:02 +0000 (18:58 +0100)]
blktap2: make protocol specific usage of shared sring explicit

I don't think protocol specific data really belongs in this header
but since it is already there and we seem to be stuck with it let's at
least make the users explicit lest people get caught out by future new
fields moving the pad field around.

This is the Xen portion of this change. The kernel portion will be
sent separately. There is no dependency between the two.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Daniel Stodden <daniel.stodden@citrix.com>
Cc: Dongxiao Xu <dongxiao.xu@intel.com>
15 years agotrace: fix security issues
Keir Fraser [Fri, 2 Jul 2010 17:56:34 +0000 (18:56 +0100)]
trace: fix security issues

After getting a report of 3.2.3's xenmon crashing Xen (as it turned
out this was because c/s 17000 was backported to that tree without
also applying c/s 17515), I figured that the hypervisor shouldn't rely
on any specific state of the actual trace buffer (as it is shared
writable with Dom0)

[GWD: Volatile quantifiers have been taken out and moved to another
patch]

To make clear what purpose specific variables have and/or where they
got loaded from, the patch also changes the type of some of them to be
explicitly u32/s32, and removes pointless assertions (like checking an
unsigned variable to be >= 0).

I also took the prototype adjustment of __trace_var() as an
opportunity to simplify the TRACE_xD() macros. Similar simplification
could be done on the (quite numerous) direct callers of the function.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
15 years agotrace: adjust printk()s
Keir Fraser [Fri, 2 Jul 2010 17:53:37 +0000 (18:53 +0100)]
trace: adjust printk()s

They should be lower level or rate limited.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
15 years agotrace: improve check_tbuf_size()
Keir Fraser [Fri, 2 Jul 2010 17:53:10 +0000 (18:53 +0100)]
trace: improve check_tbuf_size()

It didn't consider the case of the incoming size not allowing for the
2*data_size range for t_buf->{prod,cons}

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
15 years agotrace: Fix T_INFO_FIRST_OFFSET calculation
Keir Fraser [Fri, 2 Jul 2010 17:52:45 +0000 (18:52 +0100)]
trace: Fix T_INFO_FIRST_OFFSET calculation

This wasn't defined correctly, thus allowing in the
num_online_cpus() == NR_CPUS case to pass a corrupted MFN to
Dom0.

Reported-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
15 years agogdbsx: Always build -- remove build-time config option.
Keir Fraser [Fri, 2 Jul 2010 17:52:12 +0000 (18:52 +0100)]
gdbsx: Always build -- remove build-time config option.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoxenpaging: Fix 32-bit build after fixed-width type changes.
Keir Fraser [Wed, 30 Jun 2010 21:12:54 +0000 (22:12 +0100)]
xenpaging: Fix 32-bit build after fixed-width type changes.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoFix #GPF injection into compat guests in vm86 code
Keir Fraser [Wed, 30 Jun 2010 17:12:43 +0000 (18:12 +0100)]
Fix #GPF injection into compat guests in vm86 code

not to let the guest disable interrupts in the real EFLAGS.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
15 years agoUse gfn_to_mfn_query() rather then gfn_to_mfn() when changing P2M types
Keir Fraser [Wed, 30 Jun 2010 17:11:42 +0000 (18:11 +0100)]
Use gfn_to_mfn_query() rather then gfn_to_mfn() when changing P2M types

Use gfn_to_mfn_query() rather then gfn_to_mfn() when changing
P2M types since we do not really want to force a PoD allocation
as a side effect.

Signed-off-by: Paul Durrant <Paul.Durrant@citrix.com>
15 years agox86: fix an off-by-one pirq range check
Keir Fraser [Wed, 30 Jun 2010 17:11:09 +0000 (18:11 +0100)]
x86: fix an off-by-one pirq range check

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agoVMX: remove useless super page recomputing in ept_set_entry.
Keir Fraser [Wed, 30 Jun 2010 17:09:16 +0000 (18:09 +0100)]
VMX: remove useless super page recomputing in ept_set_entry.

Caller to ept_set_entry must give a valid order that hardware
supports, see set_p2m_entry in p2m.c.

Signed-off-by: Xin Li <xin.li@intel.com>
15 years agox86 oprofile: use rdmsrl/wrmsrl
Keir Fraser [Tue, 29 Jun 2010 17:20:14 +0000 (18:20 +0100)]
x86 oprofile: use rdmsrl/wrmsrl

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years agotrace: share t_info pages only in read-only mode
Keir Fraser [Tue, 29 Jun 2010 17:18:42 +0000 (18:18 +0100)]
trace: share t_info pages only in read-only mode

There's no need to share writably the t_info pages (Dom0 only wants
[and needs] to read it)

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
15 years agoUse fixed-width types in the memory event interface
Keir Fraser [Tue, 29 Jun 2010 17:17:44 +0000 (18:17 +0100)]
Use fixed-width types in the memory event interface

Set the types in the public memory_event header file to use
fixed-sized and self-aligned fields rather than "unsigned long".  AIUI
this feature only works with 64-bit hypervisors but I think this
change will be necessary to use 32-on-64 dom0 tools.

This breaks compatibility with older builds of the tools, but I can't
see any way to avoid it short of __attribute__((__packed__)).

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Patrick Colp <pjcolp@cs.ubc.ca>
15 years agox86: Only build memory-event features on 64-bit Xen
Keir Fraser [Tue, 29 Jun 2010 17:16:41 +0000 (18:16 +0100)]
x86: Only build memory-event features on 64-bit Xen

32-bit Xen doesn't have enough p2m types to support them.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
15 years agogpxe: Add eb-roms.h to hgignore list and build ROMs serially.
Keir Fraser [Tue, 29 Jun 2010 12:43:18 +0000 (13:43 +0100)]
gpxe: Add eb-roms.h to hgignore list and build ROMs serially.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agogpxe: Build e1000 ROM with PCI-ID matching that advertised by qemu-dm.
Keir Fraser [Tue, 29 Jun 2010 12:33:37 +0000 (13:33 +0100)]
gpxe: Build e1000 ROM with PCI-ID matching that advertised by qemu-dm.

Also build gpxe without -Werror and require it always to be built (do
not include a pre-built binary in our source repo).

Portions of this patch are from Gianni Tedesco <gianni.tedesco@citrix.com>

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agox86: send_IPI_mask() ignores offline CPUs in given cpumask.
Keir Fraser [Tue, 29 Jun 2010 12:16:22 +0000 (13:16 +0100)]
x86: send_IPI_mask() ignores offline CPUs in given cpumask.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoMerge
Ian Jackson [Mon, 28 Jun 2010 16:40:16 +0000 (17:40 +0100)]
Merge

15 years agotools/ocaml: Add .NOTPARALLEL to Makefile
Ian Jackson [Mon, 28 Jun 2010 16:35:10 +0000 (17:35 +0100)]
tools/ocaml: Add .NOTPARALLEL to Makefile

tools/ocaml was capable of descending into lib/* and xenstored/
simultaneously, obviously with poor results.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl: Specify no nics to qemu when no emulated nics
Ian Jackson [Mon, 28 Jun 2010 16:13:43 +0000 (17:13 +0100)]
libxl: Specify no nics to qemu when no emulated nics

qemu will default to one emulated NIC if no network configuration is
specified on the command-line.  If there are no emualted NICs (i.e.,
no NICs or all NICs are PV), specify no nics to avoid getting an
emulated NIC by default.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
15 years agolibxl: Pass bridge config info into xenstore
Ian Jackson [Mon, 28 Jun 2010 16:10:38 +0000 (17:10 +0100)]
libxl: Pass bridge config info into xenstore

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
15 years agotools/libxc: Do not crash freeing logger on xc_interface_open error path
Ian Jackson [Mon, 28 Jun 2010 15:56:52 +0000 (16:56 +0100)]
tools/libxc: Do not crash freeing logger on xc_interface_open error path

libxc could sometimes free the logger which xl created.
Thanks to report from Yang Hongyang <yanghy@cn.fujitsu.com>.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agotools/python: sxp parser: show empty string
Ian Jackson [Mon, 28 Jun 2010 15:49:45 +0000 (16:49 +0100)]
tools/python: sxp parser: show empty string

This patch makes the sxp parser show empty string.

Test case:
 import sxp
 sxp.show(sxp.from_string('(a "")'))
 sxp.show(sxp.from_string("(a '')"))

Without this patch:
 (a )(a )
With this patch:
 (a '')(a '')

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
15 years agovtd: Only kill_timer() an init_timer()'ed timer.
Keir Fraser [Mon, 28 Jun 2010 15:45:19 +0000 (16:45 +0100)]
vtd: Only kill_timer() an init_timer()'ed timer.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoxentrace: restrict trace buffer MFNs
Keir Fraser [Mon, 28 Jun 2010 15:27:56 +0000 (16:27 +0100)]
xentrace: restrict trace buffer MFNs

Since they're being passed to Dom0 using an array of uint32_t, they
must be representable as 32-bit quantities, and hence the buffer
allocation must specify an upper address boundary.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
15 years agoMerge
Keir Fraser [Fri, 25 Jun 2010 15:05:20 +0000 (16:05 +0100)]
Merge

15 years agox86 mtrr: use rdmsrl
Keir Fraser [Fri, 25 Jun 2010 15:04:47 +0000 (16:04 +0100)]
x86 mtrr: use rdmsrl

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years agoMerge
Ian Jackson [Fri, 25 Jun 2010 14:53:53 +0000 (15:53 +0100)]
Merge

15 years agosvm: use wrmsrl
Keir Fraser [Fri, 25 Jun 2010 14:45:50 +0000 (15:45 +0100)]
svm: use wrmsrl

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years agox86 paging_domctl: reinstates the breaks in the flow control (and
Keir Fraser [Fri, 25 Jun 2010 14:44:58 +0000 (15:44 +0100)]
x86 paging_domctl: reinstates the breaks in the flow control (and
folds two identical cases together) and fixes the memory leak that was
causing a crash.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
15 years agolibxc: Fix ia64 build for interface change
Ian Jackson [Fri, 25 Jun 2010 14:43:50 +0000 (15:43 +0100)]
libxc: Fix ia64 build for interface change

This patch fixes ia64 by the following method:
- rename xc_handle xch
- rename guest_xc xch
- add xc_interface *xch to arguments of some functions
- replace xc_dom_printf with macros
- Add *xch argument to corresponding x86 functions [iwj]

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoxend: Fix up check "mac" address sooner change
Ian Jackson [Fri, 25 Jun 2010 14:13:11 +0000 (15:13 +0100)]
xend: Fix up check "mac" address sooner change

In changeset 21653,
         dev_type = sxp.name(dev_config)
should not have been moved, otherwise, the checking "mac"
paragraph is of no use.

(The original patch as submitted was correct but I had to make the
change manually as it had been mangled.)

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by Chunyan Liu <CYLiu@novell.com>

15 years agox86 cpufreq: Fixes after msr cleanup patch
Keir Fraser [Fri, 25 Jun 2010 12:23:49 +0000 (13:23 +0100)]
x86 cpufreq: Fixes after msr cleanup patch

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agox86 cpu: use rdmsrl/wrmsrl
Keir Fraser [Fri, 25 Jun 2010 12:10:46 +0000 (13:10 +0100)]
x86 cpu: use rdmsrl/wrmsrl

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years agox86 cpufreq: use rdmsrl/wrmsrl
Keir Fraser [Fri, 25 Jun 2010 11:58:27 +0000 (12:58 +0100)]
x86 cpufreq: use rdmsrl/wrmsrl

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years ago[IA64] counter part of 21407:e4028345ad48
Keir Fraser [Fri, 25 Jun 2010 07:39:44 +0000 (08:39 +0100)]
[IA64] counter part of 21407:e4028345ad48

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
15 years agox86: use rdmsrl/wrmsrl
Keir Fraser [Thu, 24 Jun 2010 20:56:03 +0000 (21:56 +0100)]
x86: use rdmsrl/wrmsrl

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years agomce: cleanup
Keir Fraser [Thu, 24 Jun 2010 20:50:18 +0000 (21:50 +0100)]
mce: cleanup

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years agox86: Fix rdmsr_safe after c/s 21600.
Keir Fraser [Thu, 24 Jun 2010 20:49:25 +0000 (21:49 +0100)]
x86: Fix rdmsr_safe after c/s 21600.

From: Kathy Hadley <Kathy.Hadley@dornerworks.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoocaml: remove bogus /dev/xen/ev[en]tchn
Ian Jackson [Thu, 24 Jun 2010 11:45:32 +0000 (12:45 +0100)]
ocaml: remove bogus /dev/xen/ev[en]tchn

Oxenstored should not try to create the evtchn device, as it:

    * creates the wrong name (/dev/xen/eventchn rather than evtchn)
    * uses a hard-coded minor number, even though this dynamically
      depends on what other misc devices are in the kernel

Remove all this code and just rely on the system to create the device.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
15 years agoMerge
Keir Fraser [Wed, 23 Jun 2010 22:24:42 +0000 (23:24 +0100)]
Merge

15 years agomce: k7 cleanup
Keir Fraser [Wed, 23 Jun 2010 22:23:57 +0000 (23:23 +0100)]
mce: k7 cleanup

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years agotmem: skip special case in alloc_heap_pages() if tmem holds no pages
Keir Fraser [Wed, 23 Jun 2010 22:23:22 +0000 (23:23 +0100)]
tmem: skip special case in alloc_heap_pages() if tmem holds no pages
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
15 years agolibxl: support reset file on sysfs
Ian Jackson [Wed, 23 Jun 2010 16:05:31 +0000 (17:05 +0100)]
libxl: support reset file on sysfs

Recent kernels have a reset file on sysfs per PCI device, to allow PCI
device reset from userspace.
This patch adds support to libxl for resetting PCI devices using the
reset file on sysfs, in case the do_flr file is not preset.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agolibxl: make libxl_wait_for_device_model clearer
Ian Jackson [Wed, 23 Jun 2010 16:04:26 +0000 (17:04 +0100)]
libxl: make libxl_wait_for_device_model clearer

at the moment libxl_wait_for_device_model waits on a xenstore watch
before checking the current value of the xenstore node, that might
contain already the value the function was looking for.

This patch changes libxl_wait_for_device_model so that it checks the
value of the xenstore node first, then waits for the watch.

xenstore watch automatically fire one time when you install them for
this exact same purpose, so the previous code is not wrong, but this
version is clearer.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agoprompt user to start xencommons first if it is not running.
Ian Jackson [Wed, 23 Jun 2010 16:01:35 +0000 (17:01 +0100)]
prompt user to start xencommons first if it is not running.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
15 years agopython/xc: [PATCH 3/3] add flask capabilities in python xc bindings
Ian Jackson [Tue, 22 Jun 2010 15:37:53 +0000 (16:37 +0100)]
python/xc: [PATCH 3/3] add flask capabilities in python xc bindings

The flask library is small, and putting everything in libxenctrl make
relying on flask functionalities in libxl easier.

libflask is left for compatibility purpose, but should be considered
deprecated, and remove in the near future. all flask_ symbols are now
xc_flask_ symbols in libxenctrl.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
15 years agolibxc: [PATCH 2/3] remove some duplicated code: helper add/del functions
Ian Jackson [Tue, 22 Jun 2010 15:37:13 +0000 (16:37 +0100)]
libxc: [PATCH 2/3] remove some duplicated code: helper add/del functions

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
15 years agolibxc: [PATCH 1/3] merge libflask into libxenctrl
Ian Jackson [Tue, 22 Jun 2010 15:36:04 +0000 (16:36 +0100)]
libxc: [PATCH 1/3] merge libflask into libxenctrl

The flask library is small, and putting everything in libxenctrl make
relying on flask functionalities in libxl easier.

libflask is left for compatibility purpose, but should be considered
deprecated, and remove in the near future. all flask_ symbols are now
xc_flask_ symbols in libxenctrl.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
15 years agoinit.d: Fix xencommons init script chkconfig configuration
Ian Jackson [Tue, 22 Jun 2010 15:22:30 +0000 (16:22 +0100)]
init.d: Fix xencommons init script chkconfig configuration

Fix the xencommons init script chkconfig configuration since the
priority was missing here and chkconfig was complaining about invalid
chkconfig script so I added both start and stop priorities to the
chkconfig line and it was working fine, the script was successfully
added to chkconfig when using `chkconfig --add xencommons` and
management using the chkconfig utility was now possible.

Tested on RHEL-5 Server with Xen-4.1-unstable installed, running on
PVops kernel 2.6.32.15 and it was working fine.

Signed-off-by: Michal Novotny <minovotn@redhat.com>
15 years agoMerge
Stefano Stabellini [Tue, 22 Jun 2010 15:09:59 +0000 (16:09 +0100)]
Merge

15 years agoCheck "mac" address sooner in device_create function, before doing device_add.
Ian Jackson [Tue, 22 Jun 2010 15:07:00 +0000 (16:07 +0100)]
Check "mac" address sooner in device_create function, before doing device_add.

In XendDomainInfo.py device_create function, when device type is
"vif", it has a paragraph to check the validity of "mac"
address. Before checking validity, device_add has been done. But after
checking validity, if the mac address is invlid, it raises VmError and
exits directly without doing clean work like removing the device item
from config info. This will cause that the incorrect mac address is
saved into VM Config file and VM fails to restart. If check "mac"
validity before doing device_add, there will be no problem.

Signed-off-by Chunyan Liu <CYLiu@novell.com>

15 years agothis patch implements few missing options in xl so that it can be
Stefano Stabellini [Tue, 22 Jun 2010 15:05:56 +0000 (16:05 +0100)]
this patch implements few missing options in xl so that it can be
used as a replacement of xm in xendomains:

- dryrun and quiet, long options to xl create;

- l, option to xl list.

printf_info is now used to print the configuration of the running VMs so
the output has been reformatted to be similar to the output of xm list -l.

There is still one command used in xendomains that is not implemented in
xl and not covered by this patch: xm shutdown. However a patch has been
sent to the list in the past and we are expecting a new version of it
soon.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agothis patch adds support for xl in xendomains: if `xm list` fails all the
Stefano Stabellini [Tue, 22 Jun 2010 15:05:30 +0000 (16:05 +0100)]
this patch adds support for xl in xendomains: if `xm list` fails all the
following commands are issued using xl instead.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agopython/xc: do not crash xend if /proc/xen/privcmd cannot be opened
Ian Jackson [Tue, 22 Jun 2010 15:00:08 +0000 (16:00 +0100)]
python/xc: do not crash xend if /proc/xen/privcmd cannot be opened

If /proc/xen/privcmd cannot be opened,
start xend occurs Segmentation fault.
Add check to fix it.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
15 years agoIf xenfs is compiled as a module, now cannot complete
Ian Jackson [Tue, 22 Jun 2010 14:39:42 +0000 (15:39 +0100)]
If xenfs is compiled as a module, now cannot complete
'service xencommons start', mount xenfs directly can fix it,
it can trigger modprobe xenfs.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
15 years agoperfc: Fix x86_64 build with perfc_arrays=y
Keir Fraser [Tue, 22 Jun 2010 06:19:38 +0000 (07:19 +0100)]
perfc: Fix x86_64 build with perfc_arrays=y

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agox86 shadow: Fix x86_32 build.
Keir Fraser [Tue, 22 Jun 2010 06:19:16 +0000 (07:19 +0100)]
x86 shadow: Fix x86_32 build.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoEnable tmem functionality for PV on HVM guests. Guest kernel
Keir Fraser [Mon, 21 Jun 2010 18:19:25 +0000 (19:19 +0100)]
Enable tmem functionality for PV on HVM guests.  Guest kernel
must still be tmem-enabled to use this functionality (e.g.
won't work for Windows), but upstream Linux tmem (aka
cleancache and frontswap) patches apply cleanly on top
of PV on HVM patches.

Also, fix up some ASSERTS and code used only when bad guest
mfns are passed to tmem.  Previous code could crash Xen
if a buggy/malicious guest passes bad gmfns.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
15 years agox86 hvm: implement HVMOP_pagetable_dying
Keir Fraser [Mon, 21 Jun 2010 18:18:27 +0000 (19:18 +0100)]
x86 hvm: implement HVMOP_pagetable_dying

This patch implements HVMOP_pagetable_dying: an hypercall for
guests to notify Xen that a pagetable is about to be destroyed so that
Xen can use it as a hint to unshadow the pagetable soon and unhook the
top-level user-mode shadow entries right away.

Gianluca Guida is the original author of this patch.

Signed-off-by: Gianluca Guida <glguida@gmail.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agoRevert 21641:2e5844e17d6f "xencommons: modprobe xenfs if it not be loaded"
Keir Fraser [Mon, 21 Jun 2010 17:37:34 +0000 (18:37 +0100)]
Revert 21641:2e5844e17d6f "xencommons: modprobe xenfs if it not be loaded"

Nacked by Jeremy Fitzhardinge and Ian Jackson.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoRevert 21640:05e127771b86 "libxc: Fix Segmentation fault of xend"
Keir Fraser [Mon, 21 Jun 2010 17:36:39 +0000 (18:36 +0100)]
Revert 21640:05e127771b86 "libxc: Fix Segmentation fault of xend"

Nacked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoxl: fix command truncation
Keir Fraser [Mon, 21 Jun 2010 17:35:10 +0000 (18:35 +0100)]
xl: fix command truncation

Fix the truncation code so that it always accepts an exact match,
even when one command is a prefix of another one.   This fixes,
e.g., "xl list"

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
15 years agovmx: Fix bug in VMX VPMU fixed function PMC offset
Keir Fraser [Mon, 21 Jun 2010 08:59:10 +0000 (09:59 +0100)]
vmx: Fix bug in VMX VPMU fixed function PMC offset

This is a minor fix to the calculation of bit-width of fixed function
perfmon counters in Intel processors.  Bits 5-12 of edx register
should be calculated as (edx & 0x1fe0) >>5 instead of using 0x1f70.

From: "John, Jaiber J" <jaiber.j.john@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoxend: fix "xm list hangs"
Keir Fraser [Mon, 21 Jun 2010 08:58:17 +0000 (09:58 +0100)]
xend: fix "xm list hangs"

If a command hold domains_lock, "xm list" would hang for waiting for
the lock. Such as creating many VMs at a script (such as 20), command
of "xm list" could hang for long time(10 mins).  I think domains_lock
here only protect update().  So, we shouldn't do update before command
of "list" really get this lock, but xm do need show the domain's
information quickly. In this patch, if command couldn't get the
domains_lock after 20 times trying, "xm list" would show the
information of VMs without update().

Signed-off-by: James Song (Wei) <jsong@novell.com>
15 years agoxencommons: modprobe xenfs if it not be loaded
Keir Fraser [Mon, 21 Jun 2010 08:57:10 +0000 (09:57 +0100)]
xencommons: modprobe xenfs if it not be loaded

If xenfs is compiled as a module, now cannot complete
'service xencommons start', modprobe xenfs can fix it.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
15 years agolibxc: Fix Segmentation fault of xend
Keir Fraser [Mon, 21 Jun 2010 08:55:12 +0000 (09:55 +0100)]
libxc: Fix Segmentation fault of xend

If /proc/xen/privcmd cannot be opened,
start xend occurs Segmentation fault.
Add check to fix it.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
15 years agocpuidle: add comments for hpet cpumask_lock usage
Keir Fraser [Fri, 18 Jun 2010 13:09:44 +0000 (14:09 +0100)]
cpuidle: add comments for hpet cpumask_lock usage

Signed-off-by: Wei Gang <gang.wei@intel.com>
15 years agoxl: tidy up around global '-v' option
Keir Fraser [Fri, 18 Jun 2010 13:09:29 +0000 (14:09 +0100)]
xl: tidy up around global '-v' option

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
15 years agoxl: allow truncation of xl subcommands
Keir Fraser [Fri, 18 Jun 2010 13:09:14 +0000 (14:09 +0100)]
xl: allow truncation of xl subcommands
for those of us who are used to typing "xm cr foo"

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
15 years agoia64: Fix xc_save error reporting
Keir Fraser [Fri, 18 Jun 2010 13:08:57 +0000 (14:08 +0100)]
ia64: Fix xc_save error reporting

This is the patch for error reporting on ia64 that has a special
handling in comparison with i386/x86_64 platforms. This is pretty
straight-forward just to fail on "cannot map mfn page" message instead
of continue since the memory is not being correctly mapped using the
xc_map_foreign_range() function.

From: Michal Novotny <minovotn@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agolibxl: give reasons for ctx init failures
Keir Fraser [Fri, 18 Jun 2010 13:07:42 +0000 (14:07 +0100)]
libxl: give reasons for ctx init failures

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
15 years agoMakefile: Separate misc dist things from dist target
Keir Fraser [Fri, 18 Jun 2010 13:07:19 +0000 (14:07 +0100)]
Makefile: Separate misc dist things from dist target

Separate the miscellaneous actions the dist: target does into its own
target so you can run them independently.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
15 years agoSwitch default Linux kernel build to 2.6.32
Keir Fraser [Fri, 18 Jun 2010 13:06:38 +0000 (14:06 +0100)]
Switch default Linux kernel build to 2.6.32

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
15 years agocpuidle: redefine cpumask_lock as rwlock_t
Keir Fraser [Thu, 17 Jun 2010 07:53:12 +0000 (08:53 +0100)]
cpuidle: redefine cpumask_lock as rwlock_t

Multiple cpus clear hpet channel cpumask simultaneously is ok. So we
can change the cpumask_lock to rwlock_t.

Signed-off-by: Wei Gang <gang.wei@intel.com>
15 years agocpuidle: redirect some hpet lock users to a new cpumask_lock
Keir Fraser [Thu, 17 Jun 2010 07:52:50 +0000 (08:52 +0100)]
cpuidle: redirect some hpet lock users to a new cpumask_lock

The hpet channel lock was also used for prevent handle_hpet_broadcast
access other cpu's timer_deadline_start/end after other cpu was
already waken up.
This purpose can be approached via a standalone lock to remove much
spins on the hpet channel lock.

Signed-off-by: Wei Gang <gang.wei@intel.com>
15 years agocpuidle: remove hpet access in hpet_broadcast_exit
Keir Fraser [Thu, 17 Jun 2010 07:52:29 +0000 (08:52 +0100)]
cpuidle: remove hpet access in hpet_broadcast_exit

hpet_broadcast_exit calls reprogram_hpet to stop possible hpet intr if
the last deep-cstate waken up cpu is waken by unexpected intrs instead
of hpet broadcast handler. This can be removed without brings much
useless intrs, but bring chance for further optimization. It is a
tradeoff between grace & optimization.

BTW, move the cpumask set out of critial section in
hpet_broadcast_enter to shorten it.

Signed-off-by: Wei Gang <gang.wei@intel.com>
15 years agocpuidle: use stime to count c-state residency in NONSTOP_TSC case
Keir Fraser [Thu, 17 Jun 2010 07:51:25 +0000 (08:51 +0100)]
cpuidle: use stime to count c-state residency in NONSTOP_TSC case

stime is based on tsc, with far less access cost than PM timer. So for
processors w/ NONSTOP_TSC, using stime instead of PM timer. This could
reduce idle overheads and save power.

Signed-off-by: Wei Gang <gang.wei@intel.com>
15 years agocpuidle: reduce redundant cost in cstate_restore_tsc for nonstop tsc
Keir Fraser [Thu, 17 Jun 2010 07:50:55 +0000 (08:50 +0100)]
cpuidle: reduce redundant cost in cstate_restore_tsc for nonstop tsc

Signed-off-by: Wei Gang <gang.wei@intel.com>
15 years agocpuidle: fix wrapped ticks calculation for pm timer.
Keir Fraser [Thu, 17 Jun 2010 07:50:18 +0000 (08:50 +0100)]
cpuidle: fix wrapped ticks calculation for pm timer.

Signed-off-by: Wei Gang <gang.wei@intel.com>
15 years agoFix sched_adjust_global() and clean up surrounding code.
Keir Fraser [Thu, 17 Jun 2010 07:02:27 +0000 (08:02 +0100)]
Fix sched_adjust_global() and clean up surrounding code.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agox86: IRQ affinity should track vCPU affinity
Keir Fraser [Thu, 17 Jun 2010 06:22:06 +0000 (07:22 +0100)]
x86: IRQ affinity should track vCPU affinity

With IRQs getting bound to the CPU the binding vCPU currently runs on
there can result quite a bit of extra cross CPU traffic as soon as
that vCPU moves to a different pCPU. Likewise, when a domain re-binds
an event channel associated with a pIRQ, that IRQ's affinity should
also be adjusted.

The open issue is how to break ties for interrupts shared by multiple
domains - currently, the last request (at any point in time) is being
honored.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agopython/xc: fix out of bounds array access
Keir Fraser [Tue, 15 Jun 2010 12:27:14 +0000 (13:27 +0100)]
python/xc: fix out of bounds array access

Writing a NUL terminator here isn't even necessary, since snprintf()
already guarantees proper termination.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agoia64: fix build
Keir Fraser [Tue, 15 Jun 2010 12:26:49 +0000 (13:26 +0100)]
ia64: fix build

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agox86: fix guest wrmsr warning format
Keir Fraser [Tue, 15 Jun 2010 12:24:11 +0000 (13:24 +0100)]
x86: fix guest wrmsr warning format

During the recent MSR handling cleanup, the '0' format modifier got
lost.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agox86/mce: assorted fixes
Keir Fraser [Tue, 15 Jun 2010 12:21:34 +0000 (13:21 +0100)]
x86/mce: assorted fixes

- correct various range checks (avoids bogus warnings on domains
  modifying virtualized MSRs)
- correct consistency check (so that APs get checked instead of the
  BP [against uninitialized data])
- reduce verbosity (capabilities printed only once, but then all of
  the relevant values)

Signed-off-by: Jan Beulich <jbeulich@novell.com>